package com.example.algorithm.no0002;

import lombok.Data;

/**
 * @Description TODO
 * @ClassName ListNode
 * @Author Administrator
 * @Date 2020/5/16 14:06
 * @Version 1.0.0
 */
@Data
public class ListNode {
    public int val;
    public ListNode next;

    public ListNode(int val) {
        this.val = val;
    }

    public static String toStr(ListNode node){
        StringBuffer sb = new StringBuffer();
        while(node != null){
            sb.append(node.val);
            node = node.next;
        }

        return sb.toString();
    }
}
